#include <stdio.h>
struct student
{
	char sno[8];
	char name[20];
	char sex;
	int age;
	double score;
};
int main(void)
{
	FILE *fp;
	struct student t[3]; 
	int i;  
	fp = fopen("stu.txt", "w");
	for (i = 0; i < 3; i++)
	{
		fscanf(fp, "%c %s %s %d %.1f\n", t[i].sex, t[i].sno, t[i].name, t[i].age, t[i].score);
	    fgetc(fp);
		fprintf(fp, "%c %s %s %d %.1f\n", t[i].sex, t[i].sno, t[i].name, t[i].age, t[i].score);
	}
	fclose(fp);
	puts("  sno              name       sex  age   score");
	fp = fopen("stu.txt", "r");
	for (i = 0; i < 3; i++)
	{
		fscanf(fp, "%c%s%s%d%lf", &t[i].sex, t[i].sno, t[i].name, &t[i].age, &t[i].score);
		fgetc(fp);
		printf("%s%20s%5c%5d%8.1f\n", t[i].sno, t[i].name, t[i].sex, t[i].age, t[i].score);
	}
	fclose(fp);
	return 0;
}